<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <#include "../common/header.ftl"/>
    <script src="/js/common.js"></script>

    <script>
        $(function () {
            $(".lookBtn").click(function () {
                var id = $(this).data("id");
                $.get("/travel/getContentById.do",{id:id},function (data) {
                    $("#contentModal .modal-body").html(data.content);
                    $("#contentModal").modal("show");
                })
            })
            $(".changeStateBtn").click(function () {
                var id = $(this).data("id");
                var state = $(this).data("state");
                $.get("/travel/changeState.do",{id:id,state:state},function (data) {
                    doSuccess();
                })
            })
        })

    </script>

    <style>
        #contentModal img{
            width: 100%
        }
        #contentModal .modal-body{
            max-height: 600px;
            overflow-y: scroll;
        }

    </style>
</head>

<body>
<div class="container">
<#include "../common/top.ftl"/>
    <div class="row">
        <div class="col-sm-3">
		<#assign currentMenu = "audit_travle" />
				<#include "../common/menu.ftl" />
        </div>
        <div class="col-sm-9">
            <div class="page-header">
                <h3>游记管理</h3>
            </div>
            <div class="row">
                <!-- 提交分页的表单 -->
                <form id="searchForm" class="form-inline" method="post" action="/travel/list.do">
                    <input type="hidden" name="currentPage" id="currentPage" value="1"/>
                    <div class="form-group">
                    </div>
                    <div class="form-group">
                        <label>关键字</label>
                        <input class="form-control" type="text" name="keyword" value="${(qo.keyword)!''}">
                    </div>
                    <div class="form-group">
                        <button id="query" type="button" class="btn btn-success"><i class="icon-search"></i> 查询</button>
                    </div>
                </form>
            </div>
            <div class="row">
                <table class="table">
                    <thead>
                    <tr>
                        <th>编号</th>
                        <th>标题</th>
                        <th>封面</th>
                        <th>地点</th>
                        <th>作者</th>
                        <th>状态</th>
                        <th></th>
                        <th></th>
                        <th></th>
                    </tr>
                    </thead>
                    <tbody>
					<#list pageInfo.list as entity>
                    <tr>
                        <td>${entity_index + 1}</td>
                        <td>${entity.title}</td>
                        <td><img src='${entity.coverUrl}' width="60px"/></td>
                        <td>${entity.place.name}</td>
                        <td>${entity.author.nickName}</td>
                        <td>${entity.stateName}</td>
                        <td>
                            <a role="button" class="changeStateBtn" data-id="${entity.id}" data-state="2">发布</a>
                        </td>
                        <td>
                            <a role="button" class="changeStateBtn" data-id="${entity.id}" data-state="-1">拒绝</a>
                        </td>
                        <td>
                            <a role="button" data-id="${entity.id}" class="lookBtn">查看内容</a>
                        </td>

                    </tr>
					</#list>
                    </tbody>
                </table>
                <#--分页-->
                  <#include "../common/page.ftl"/>
            </div>
        </div>
    </div>
</div>

<!--弹出文章模态框-->
<div id="contentModal" class="modal" tabindex="-1" role="dialog">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">查看内容</h4>
            </div>
            <div class="modal-body">

            </div>
            <div class="modal-footer">
                <a href="javascript:void(0);" class="btn" data-dismiss="modal" aria-hidden="true">关闭</a>
            </div>
        </div>
    </div>
</div>


</body>
</html>